package com.haixiaoke.saas.role.service.impl;

import java.util.List;

import com.haixiaoke.saas.role.domain.BizRoleDept;
import com.haixiaoke.saas.role.mapper.BizRoleDeptMapper;
import com.haixiaoke.saas.role.service.IBizRoleDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 企业端角色和部门关联Service业务层处理
 * 
 * @author panda
 * @date 2023-12-29
 */
@Service
public class BizRoleDeptServiceImpl implements IBizRoleDeptService {
    @Autowired
    private BizRoleDeptMapper bizRoleDeptMapper;

    /**
     * 查询企业端角色和部门关联
     * 
     * @param roleId 企业端角色和部门关联主键
     * @return 企业端角色和部门关联
     */
    @Override
    public BizRoleDept selectBizRoleDeptByRoleId(Long roleId) {
        return bizRoleDeptMapper.selectBizRoleDeptByRoleId(roleId);
    }

    /**
     * 查询企业端角色和部门关联列表
     * 
     * @param bizRoleDept 企业端角色和部门关联
     * @return 企业端角色和部门关联
     */
    @Override
    public List<BizRoleDept> selectBizRoleDeptList(BizRoleDept bizRoleDept) {
        return bizRoleDeptMapper.selectBizRoleDeptList(bizRoleDept);
    }

    /**
     * 新增企业端角色和部门关联
     * 
     * @param bizRoleDept 企业端角色和部门关联
     * @return 结果
     */
    @Override
    public int insertBizRoleDept(BizRoleDept bizRoleDept) {
        return bizRoleDeptMapper.insertBizRoleDept(bizRoleDept);
    }

    /**
     * 修改企业端角色和部门关联
     * 
     * @param bizRoleDept 企业端角色和部门关联
     * @return 结果
     */
    @Override
    public int updateBizRoleDept(BizRoleDept bizRoleDept) {
        return bizRoleDeptMapper.updateBizRoleDept(bizRoleDept);
    }

    /**
     * 批量删除企业端角色和部门关联
     * 
     * @param roleIds 需要删除的企业端角色和部门关联主键
     * @return 结果
     */
    @Override
    public int deleteBizRoleDeptByRoleIds(Long[] roleIds) {
        return bizRoleDeptMapper.deleteBizRoleDeptByRoleIds(roleIds);
    }

    /**
     * 删除企业端角色和部门关联信息
     * 
     * @param roleId 企业端角色和部门关联主键
     * @return 结果
     */
    @Override
    public int deleteBizRoleDeptByRoleId(Long roleId) {
        return bizRoleDeptMapper.deleteBizRoleDeptByRoleId(roleId);
    }

    @Override
    public int batchRoleDept(List<BizRoleDept> list) {
        return bizRoleDeptMapper.batchRoleDept(list);
    }
}
